//
//  MKTChatItem_4_TVCell.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2021/7/14.
//  Copyright © 2021 moon. All rights reserved.
//

#import "MKTChatItem_4_TVCell.h"

@implementation MKTChatItem_4_TVCell
+ (void)load{
    [self registerTableViewCellFor:[MKTChatItem_4 class]];
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.ititleLabel = [[UILabel alloc] init];
        self.ititleLabel.textColor = [UIColor mk_colorWithLight:[UIColor grayColor] dark:[UIColor lightTextColor]];
        self.ititleLabel.font = [UIFont boldSystemFontOfSize:24];
        self.ititleLabel.numberOfLines = 0;
        self.ititleLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:self.ititleLabel];
        //
        self.flowlayout = [[MKUIFlowLayoutConstraint alloc] initWithItems:@[self.ititleLabel] constraintParam:(MKUIFlowLayoutConstraintParam_H_C_C) contentInsets:UIEdgeInsetsMake(40, 10, 40, 10) interitemSpacing:5];
    }
    return self;
}

- (void)customLayoutSubviews{
    [super customLayoutSubviews];
    CGRect bounds = self.contentView.bounds;
    self.flowlayout.bounds = bounds;
    [self.flowlayout layoutItemsWithResizeItems:YES];
}
- (CGSize)customSizeThatFits:(CGSize)size{
    return [self.flowlayout sizeThatFits:size resizeItems:YES];
}
- (void)customReloadCellModel{
    [super customReloadCellModel];
    MKTChatItem_4 *modelValue = self.cellModel.modelValue;
    self.ititleLabel.text = modelValue.ititle;
}
@end
